package com.itmk.web.goods_collect.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itmk.web.goods_collect.entity.GoodsCollect;
import com.itmk.web.goods_collect.entity.PageParm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 山顶洞人郑某
 * @className GoodsCollectMapper.java
 * @date 2023 12 11
 */
@Mapper
public interface GoodsCollectMapper extends BaseMapper<GoodsCollect> {
        //收藏商品分页查询
    IPage<PageParm> getMyCollect(IPage<PageParm> page, @Param("userId") Long userId);

    @Select("select collect_id from max_id where id = 1")
    Long maxId();

    @Update("update max_id set collect_id = #{l} where id = 1")
    void updaeMaxId( long l);
}
